#include<iostream>
using namespace std;
#include"QuickFind.h"
void test01()
{
	int n = 9;
	QuickFindSet* set = createQFSet(n);
	Element_t data[9];
	for (int i = 0; i < n; i++)
	{
		data[i] = i;
	}
	initQFSet(set,data,9);

	unionQFSet(set, 3, 4);
	unionQFSet(set, 8, 0);
	unionQFSet(set, 2, 3);
	unionQFSet(set, 5, 6);

	if (findQFSet(set,2, 0)) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}
}
int main()
{
	test01();
	return 0;
}